<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Java源码</title>
    <style type="text/css">
        .keyword{font-weight: bold; color: blue;}
        .comment{font-style: italic; color: silver;}
        .var{color: red;}
    </style>
</head>
<body>
    <pre>
<span class=keyword>package</span> ch14;

<span class=keyword>import</span> java.io.BufferedReader;
<span class=keyword>import</span> java.io.FileReader;
<span class=keyword>import</span> java.util.Iterator;
<span class=keyword>import</span> java.util.TreeSet;

<span class=keyword>public</span> <span class=keyword>class</span> test {
    <span class=keyword>public</span> <span class=keyword>static</span> <span class=keyword>void</span> main(String[] args) <span class=keyword>throws</span> Exception {
        TreeSet&lt;String&gt; set = <span class=keyword>new</span> TreeSet&lt;String&gt;();
        <span class=comment>// TreeSet&lt;String&gt; set = <span class=keyword>new</span> TreeSet&lt;String&gt;();
</span>        FileReader fr_1 = <span class=keyword>new</span> FileReader(args[<span class=var>0</span>]);
        BufferedReader br_1 = <span class=keyword>new</span> BufferedReader(fr_1);
        <span class=comment>/*
         * FileReader fr_1 = <span class=keyword>new</span> FileReader(args[<span class=var>0</span>]); BufferedReader br_1 = <span class=keyword>new</span>
         * BufferedReader(fr_1);
         */</span>
        String line_1 = br_1.readLine();
        <span class=keyword>while</span> (line_1 != <span class=keyword>null</span>) {
            String[] words = line_1.split(<span class=var>"[^a-zA-Z]"</span>);
            <span class=keyword>for</span> (String str : words) {
                <span class=keyword>if</span> (str.length() != <span class=var>0</span>)
                    set.add(str);
            }
            line_1 = br_1.readLine();
        }
        br_1.close();
        Iterator iterator = set.iterator();
        <span class=keyword>while</span> (iterator.hasNext())
            System.out.println(iterator.next());
    }
}
    </pre>
</body>
</html>
